<template>
  <div>
    <h1>用户登录列表页面</h1>

    <table>
      <tr>
        <td>用户名</td>
        <td>密码</td>
      </tr>
      <tr v-for="item in info">
        <td>{{item.UserName}}</td>
        <td>{{item.UserPWd.substring(0,4)+"***"}}</td>
      </tr>
    </table>
  </div>
</template>

<script setup lang="ts">
    import axios from 'axios';
    import {reactive,toRefs,onMounted} from 'vue'
   
    let data:any=reactive({
      info:[]
    })

    let {info} =toRefs(data);

    onMounted(()=>{
      getList();
    })

    const getList=()=>{
      axios({
        url:'/api/User/Show',
        method:'get',
        params:{}
      }).then(res=>{
        console.log(res.data);
        
        info.value=res.data
      }).catch(err=>{

      })
    }


</script>

<style scoped>

</style>
